<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv= "X-UA-Compatible" content = "IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>博艺网-订单详情</title>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <script type='text/javascript' src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://m.sui.taobao.org/assets/js/zepto.js' charset='utf-8'></script>
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <link rel="stylesheet" href="//g.alicdn.com/msui/sm/0.6.2/css/??sm.min.css,sm-extend.min.css">
    <script type='text/javascript' src='//g.alicdn.com/msui/sm/0.6.2/js/??sm.min.js,sm-extend.min.js' charset='utf-8'></script>
</head>
<body>

<#--<header class="bar bar-nav">-->
    <#--<h1 class="title">卡片</h1>-->
<#--</header>-->
<div class="content">

    <div class="card">
        <div class="card-header">支付状态:${detail.order.getPayStatusStr()}</div>
    </div>

    <div class="card">
        <div class="card-header">订单号:${detail.orderId?string}</div>
        <div class="card-header">下单时间:${detail.order.createTime?date("yyyy-MM-dd")}</div>
        <div class="card-header">婚礼商家:${detail.order.bizUser.getCnName()!''}</div>
        <div class="card-header">支付方式:${detail.order.getPayType()?string}</div>
        <div class="card-header">备注信息:${detail.order.descn!''}</div>
    </div>

    <div class="card">
        <div class="card-header">订单总金额:${detail.order.getPrice()?string("0.00")}元</div>
        <div class="card-header">费用明细:</div>
        <#if detail.productList??>
            <#list detail.productList as product>
                <div class="card-footer">
                    <span>${product.byUserBizProduct.getName()}</span>
                    <span>￥${product.byUserBizProduct.getCurrentPrice()?string("0.00")}元 X ${product.getAmount()?string}</span>
                </div>
            </#list>
        </#if>

    </div>

    <div class="card">
        <div class="card-footer">
            <#if detail.order.getPayStatus() == -1>
                <span><a href="/weixin/wxPay_auth?order_id=${detail.orderId?string}&pay_status=2" class="button">支付全款</a></span>
                <#--<span><a href="/weixin/wxPay_auth?order_id=${detail.orderId?string}&pay_status=1" class="button">支付定金</a></span>-->
                <span><a href="/weixin/orderChangeStatus?order_id=${detail.orderId?string}&status=3" class="button button-light">取消订单</a></span>
            <#elseif detail.order.getPayStatus() != -1 && detail.order.getStatus() != 6 >
                <span><a href="/weixin/orderChangeStatus?order_id=${detail.orderId?string}&status=6" class="button">确认订单完成</a></span>
                <span><a href="/weixin/orderChangeStatus?order_id=${detail.orderId?string}&status=3" class="button button-light">取消订单</a></span>
            <#--<#elseif detail.order.getPayStatus() != -1 && detail.order.getStatus() == 6 >-->
                <#--<span><a href="/weixin/addOrderComment?order_id=${detail.orderId?string}" class="button">订单评论</a></span>-->
            </#if>

        </div>
    </div>
</div>

</body>

<script type="text/javascript" src="/common/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/common/js/bootstrap-table.20130913.js"></script>
<script type="text/javascript" src="/common/js/dateformat.js"></script>
<script type="text/javascript" src="/common/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    function renderOrderStatus(status) {
        if (status == -1) {
            return "待审核";
        } else if(status == 1) {
            return "审核通过,待接单";
        } else if(status == 2) {
            return "商家接单";
        } else if(status == 3) {
            return "订单取消";
        }else if(status == 4) {
            return "订单取消已退款";
        }else if(status == 5) {
            return "商家完成订单";
        }else if(status == 6) {
            return "用户确认完成订单";
        }else{
            return "未知状态";
        }
    }

    function renderPayType(payType) {
        if (payType == 1) {
            return "支付宝";
        } else if(payType == 2) {
            return "微信支付";
        }else{
            return "其他";
        }
    }

    function renderOrderPayStatus(payStatus) {
        if (payStatus == -1) {
            return "未付款";
        } else if(payStatus == 1) {
            return "已付定金,未付尾款";
        }else if(payStatus == 2) {
            return "已付定金和尾款";
        }else{
            return "未知状态";
        }
    }

    function renderOperation(row) {
        if (row){
            if (row.status == -1) {
                return '<a style="width: 80px;margin: 3px 1px;" href="/order/orderAdminChangeStatus?order_id='+row.id+'&status=1" class="btn btn-info">客服确认</a>' +
                        '<a style="width: 80px;margin: 3px 0;" href="/order/orderDetailManage?order_id='+row.id+'" class="btn btn-success">查看详情</a>';
            }else{
                return '<a style="width: 80px;margin: 3px 0;" href="/order/orderDetailManage?order_id='+row.id+'" class="btn btn-success">查看详情</a>';
            }
        }else{
            return ""
        }

    }
    //
    ////    <td>
    ////    <a style="width: 80px;margin: 3px 0;" href="/order/orderChangeStatus?order_id=&status=1" class="btn btn-info">客服确认</a>
    ////            <a style="width: 80px;margin: 3px 0;" href="/order/orderChangeStatus?order_id=status=2" class="btn btn-info">商家接单</a>
    ////            <a style="width: 80px;margin: 3px 0;" href="/order/orderChangeStatus?order_id=status=3" class="btn btn-info">取消订单</a>
    ////            <a style="width: 80px;margin: 3px 0;" href="/order/orderDetailManage?order_id={{id}}" class="btn btn-success">查看详情</a></td>


</script>

</html>